\hypertarget{classWorkerDiscovery}{
\section{WorkerDiscovery Class Reference}
\label{classWorkerDiscovery}\index{WorkerDiscovery@{WorkerDiscovery}}
}
{\tt \#include $<$workerdiscovery.h$>$}

\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
\hypertarget{classWorkerDiscovery_7a81acabff6477a5778333833d7a1f52}{
\hyperlink{classWorkerDiscovery_7a81acabff6477a5778333833d7a1f52}{WorkerDiscovery} (boost::uint16\_\-t port=13000)}
\label{classWorkerDiscovery_7a81acabff6477a5778333833d7a1f52}

\begin{CompactList}\small\item\em Constructor. Default port value is 13000. \item\end{CompactList}\item 
\hyperlink{classWorkerDiscovery_75f15b1453c9b838e6ae556e7f81c4e8}{WorkerDiscovery} (const \hyperlink{classAddress}{Address} \&address)
\begin{CompactList}\small\item\em Constructor specifying address object. \item\end{CompactList}\item 
\hypertarget{classWorkerDiscovery_9d24a1c2a170ca4c3a94a0e46b0f6d59}{
\hyperlink{classWorkerDiscovery_9d24a1c2a170ca4c3a94a0e46b0f6d59}{$\sim$WorkerDiscovery} (void)}
\label{classWorkerDiscovery_9d24a1c2a170ca4c3a94a0e46b0f6d59}

\begin{CompactList}\small\item\em Destructor. \item\end{CompactList}\item 
\hypertarget{classWorkerDiscovery_390a637bacc348a54222ff1ef9482a66}{
void \hyperlink{classWorkerDiscovery_390a637bacc348a54222ff1ef9482a66}{run} (void)}
\label{classWorkerDiscovery_390a637bacc348a54222ff1ef9482a66}

\begin{CompactList}\small\item\em Listens for UDP packets and create a new servant for the request. \item\end{CompactList}\item 
\hyperlink{classAddress}{Address} \hyperlink{classWorkerDiscovery_b0ba0e39fe90e2a1eea5c4f8e214d28d}{getWorker} (const \hyperlink{classTaskDescriptor}{TaskDescriptor} \&td)
\begin{CompactList}\small\item\em Returns the address of a worker capable of handling provided \hyperlink{classTaskDescriptor}{TaskDescriptor}. \item\end{CompactList}\item 
void \hyperlink{classWorkerDiscovery_03804c2919a9040572bf54625fa80108}{updateWorker} (size\_\-t index, const \hyperlink{classWorkerDescriptor}{WorkerDescriptor} \&wd)
\begin{CompactList}\small\item\em Repleces \hyperlink{classWorkerDescriptor}{WorkerDescriptor} object at provided index with the provided one. \item\end{CompactList}\item 
void \hyperlink{classWorkerDiscovery_c6f00056306b788e4aeb1e3652b672b4}{addWorker} (const \hyperlink{classWorkerDescriptor}{WorkerDescriptor} \&wd)
\begin{CompactList}\small\item\em Adds provided \hyperlink{classWorkerDescriptor}{WorkerDescriptor} object into the container of workers. \item\end{CompactList}\item 
void \hyperlink{classWorkerDiscovery_949533d5d9764386042e98c9f789dcdb}{removeWorker} (size\_\-t index)
\begin{CompactList}\small\item\em Removes the \hyperlink{classWorkerDescriptor}{WorkerDescriptor} object at the provided position from the container of workers. \item\end{CompactList}\item 
\hypertarget{classWorkerDiscovery_9b1083d83c848a1d459568b55ddd9c9d}{
void \hyperlink{classWorkerDiscovery_9b1083d83c848a1d459568b55ddd9c9d}{clear} (void)}
\label{classWorkerDiscovery_9b1083d83c848a1d459568b55ddd9c9d}

\begin{CompactList}\small\item\em Erases the container of workers. \item\end{CompactList}\item 
collection\_\-size\_\-t \hyperlink{classWorkerDiscovery_cfb7b99966621e775e0ec7fde537730e}{size} (void)
\begin{CompactList}\small\item\em Returns the number of registered workers. \item\end{CompactList}\item 
bool \hyperlink{classWorkerDiscovery_4c3ee16da491117498efc8bfd9b03a24}{empty} (void)
\begin{CompactList}\small\item\em Checks whenever the container of workers is empty. \item\end{CompactList}\item 
boost::uint16\_\-t \hyperlink{classWorkerDiscovery_6e927912f9294353a4b677f1b9a1a507}{getPort} (void) const 
\begin{CompactList}\small\item\em Gets server port. \item\end{CompactList}\item 
void \hyperlink{classWorkerDiscovery_160a74478e35c98cc4bea66f261735da}{setPort} (boost::uint16\_\-t port)
\begin{CompactList}\small\item\em Sets server port. \item\end{CompactList}\item 
void \hyperlink{classWorkerDiscovery_e82fb23c9730ebf4445541d0d2464244}{setPort} (const \hyperlink{classAddress}{Address} \&address)
\begin{CompactList}\small\item\em Sets server port using provided \hyperlink{classAddress}{Address}. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
\hyperlink{classWorkerDiscovery}{WorkerDiscovery}

Provides local access to workers list for discovery node. It also hosts a a server for manager node, providing a suitable worker, and a server for workers node, providing subscription services. 

\subsection{Constructor \& Destructor Documentation}
\hypertarget{classWorkerDiscovery_75f15b1453c9b838e6ae556e7f81c4e8}{
\index{WorkerDiscovery@{WorkerDiscovery}!WorkerDiscovery@{WorkerDiscovery}}
\index{WorkerDiscovery@{WorkerDiscovery}!WorkerDiscovery@{WorkerDiscovery}}
\subsubsection[WorkerDiscovery]{\setlength{\rightskip}{0pt plus 5cm}WorkerDiscovery::WorkerDiscovery (const {\bf Address} \& {\em address})\hspace{0.3cm}{\tt  \mbox{[}inline\mbox{]}}}}
\label{classWorkerDiscovery_75f15b1453c9b838e6ae556e7f81c4e8}


Constructor specifying address object. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em address}]Server address. \end{description}
\end{Desc}


\subsection{Member Function Documentation}
\hypertarget{classWorkerDiscovery_b0ba0e39fe90e2a1eea5c4f8e214d28d}{
\index{WorkerDiscovery@{WorkerDiscovery}!getWorker@{getWorker}}
\index{getWorker@{getWorker}!WorkerDiscovery@{WorkerDiscovery}}
\subsubsection[getWorker]{\setlength{\rightskip}{0pt plus 5cm}{\bf Address} WorkerDiscovery::getWorker (const {\bf TaskDescriptor} \& {\em td})}}
\label{classWorkerDiscovery_b0ba0e39fe90e2a1eea5c4f8e214d28d}


Returns the address of a worker capable of handling provided \hyperlink{classTaskDescriptor}{TaskDescriptor}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em td}]The provided \hyperlink{classTaskDescriptor}{TaskDescriptor}. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The \hyperlink{classAddress}{Address} of a Worker capable to handle provided \hyperlink{classTaskDescriptor}{TaskDescriptor}. \end{Desc}
\hypertarget{classWorkerDiscovery_03804c2919a9040572bf54625fa80108}{
\index{WorkerDiscovery@{WorkerDiscovery}!updateWorker@{updateWorker}}
\index{updateWorker@{updateWorker}!WorkerDiscovery@{WorkerDiscovery}}
\subsubsection[updateWorker]{\setlength{\rightskip}{0pt plus 5cm}void WorkerDiscovery::updateWorker (size\_\-t {\em index}, \/  const {\bf WorkerDescriptor} \& {\em wd})}}
\label{classWorkerDiscovery_03804c2919a9040572bf54625fa80108}


Repleces \hyperlink{classWorkerDescriptor}{WorkerDescriptor} object at provided index with the provided one. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em index}]The provided position in the collection. \item[{\em wd}]The new \hyperlink{classWorkerDescriptor}{WorkerDescriptor} that will replace the old one. \end{description}
\end{Desc}
\hypertarget{classWorkerDiscovery_c6f00056306b788e4aeb1e3652b672b4}{
\index{WorkerDiscovery@{WorkerDiscovery}!addWorker@{addWorker}}
\index{addWorker@{addWorker}!WorkerDiscovery@{WorkerDiscovery}}
\subsubsection[addWorker]{\setlength{\rightskip}{0pt plus 5cm}void WorkerDiscovery::addWorker (const {\bf WorkerDescriptor} \& {\em wd})}}
\label{classWorkerDiscovery_c6f00056306b788e4aeb1e3652b672b4}


Adds provided \hyperlink{classWorkerDescriptor}{WorkerDescriptor} object into the container of workers. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em wd}]The provided \hyperlink{classWorkerDescriptor}{WorkerDescriptor}. \end{description}
\end{Desc}
\hypertarget{classWorkerDiscovery_949533d5d9764386042e98c9f789dcdb}{
\index{WorkerDiscovery@{WorkerDiscovery}!removeWorker@{removeWorker}}
\index{removeWorker@{removeWorker}!WorkerDiscovery@{WorkerDiscovery}}
\subsubsection[removeWorker]{\setlength{\rightskip}{0pt plus 5cm}void WorkerDiscovery::removeWorker (size\_\-t {\em index})}}
\label{classWorkerDiscovery_949533d5d9764386042e98c9f789dcdb}


Removes the \hyperlink{classWorkerDescriptor}{WorkerDescriptor} object at the provided position from the container of workers. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em index}]The provided position. \end{description}
\end{Desc}
\hypertarget{classWorkerDiscovery_cfb7b99966621e775e0ec7fde537730e}{
\index{WorkerDiscovery@{WorkerDiscovery}!size@{size}}
\index{size@{size}!WorkerDiscovery@{WorkerDiscovery}}
\subsubsection[size]{\setlength{\rightskip}{0pt plus 5cm}WorkerDiscovery::collection\_\-size\_\-t WorkerDiscovery::size (void)}}
\label{classWorkerDiscovery_cfb7b99966621e775e0ec7fde537730e}


Returns the number of registered workers. 

\begin{Desc}
\item[Returns:]The number of workers (which is actually the container size). \end{Desc}
\hypertarget{classWorkerDiscovery_4c3ee16da491117498efc8bfd9b03a24}{
\index{WorkerDiscovery@{WorkerDiscovery}!empty@{empty}}
\index{empty@{empty}!WorkerDiscovery@{WorkerDiscovery}}
\subsubsection[empty]{\setlength{\rightskip}{0pt plus 5cm}bool WorkerDiscovery::empty (void)}}
\label{classWorkerDiscovery_4c3ee16da491117498efc8bfd9b03a24}


Checks whenever the container of workers is empty. 

\begin{Desc}
\item[Returns:]true if the container is empty, otherwise false. \end{Desc}
\hypertarget{classWorkerDiscovery_6e927912f9294353a4b677f1b9a1a507}{
\index{WorkerDiscovery@{WorkerDiscovery}!getPort@{getPort}}
\index{getPort@{getPort}!WorkerDiscovery@{WorkerDiscovery}}
\subsubsection[getPort]{\setlength{\rightskip}{0pt plus 5cm}boost::uint16\_\-t WorkerDiscovery::getPort (void) const}}
\label{classWorkerDiscovery_6e927912f9294353a4b677f1b9a1a507}


Gets server port. 

\begin{Desc}
\item[Returns:]Server port. \end{Desc}
\hypertarget{classWorkerDiscovery_160a74478e35c98cc4bea66f261735da}{
\index{WorkerDiscovery@{WorkerDiscovery}!setPort@{setPort}}
\index{setPort@{setPort}!WorkerDiscovery@{WorkerDiscovery}}
\subsubsection[setPort]{\setlength{\rightskip}{0pt plus 5cm}void WorkerDiscovery::setPort (boost::uint16\_\-t {\em port})}}
\label{classWorkerDiscovery_160a74478e35c98cc4bea66f261735da}


Sets server port. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em port}]The provided port. \end{description}
\end{Desc}
\hypertarget{classWorkerDiscovery_e82fb23c9730ebf4445541d0d2464244}{
\index{WorkerDiscovery@{WorkerDiscovery}!setPort@{setPort}}
\index{setPort@{setPort}!WorkerDiscovery@{WorkerDiscovery}}
\subsubsection[setPort]{\setlength{\rightskip}{0pt plus 5cm}void WorkerDiscovery::setPort (const {\bf Address} \& {\em address})}}
\label{classWorkerDiscovery_e82fb23c9730ebf4445541d0d2464244}


Sets server port using provided \hyperlink{classAddress}{Address}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em address}]Server address. \end{description}
\end{Desc}


The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
\hyperlink{workerdiscovery_8h}{workerdiscovery.h}\item 
\hyperlink{workerdiscovery_8cpp}{workerdiscovery.cpp}\end{CompactItemize}
